﻿using ApiGateway.Interface;
using HttpService.Interface;

namespace HttpApiGateway.PlugIn
{
    internal class RouteShieIdPlugIn : BasicPlugin
    {
        private readonly IShieIdPlugIn _Service;
        public RouteShieIdPlugIn()
        {
            _Service = RpcClient.RpcClient.Unity.Resolve<IShieIdPlugIn>();
            _Init(_Service);
        }

        public override void Exec(IRoute route, IHttpHandler handler)
        {
            if (_Service.CheckIsShieId(route.ApiUri))
            {
                handler.Response.SetHttpStatus(System.Net.HttpStatusCode.NotFound);
                handler.Response.End();
            }
        }
    }
}
